package com.zyh.homework.test1;

import com.zyh.homework.test1.domain.Student;
import com.zyh.homework.test1.impl.ComparableImpl;

import java.util.LinkedList;
import java.util.List;

/**
 * @Author zyh
 * @Date 2024/7/31 16:52
 * @Description
 */

public class Test1 {
    public static void main(String[] args) {
        ComparableImpl comparableImpl=new ComparableImpl();
        LinkedList<Student> list=new LinkedList<>();
        list.add(new Student("liusan" ,20,90.0));
        list.add(new Student("lisi" ,22,90.0));
        list.add(new Student("wangwu" ,20,99.0));
        list.add(new Student("sunliu" ,22,100.0));
        System.out.println("按照成绩排序：");
        List<Student> newList1 = comparableImpl.sortScore(list);
        System.out.println(newList1);
        System.out.println("按照年龄排序：");
        List<Student> newList2 = comparableImpl.sortAge(list);
        System.out.println(newList2);
    }
}
